package controllers.listeners.semrep;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import controllers.MainModuleController;

import objects.Constituent;

import views.MainPanel;

/* Creates a new semantic representation */
/* actionPerformed when you click on the menu "PROGRAM" and then click the menu item "New Semantic Representation" */
public class MenuNewSemRepActionListener implements ActionListener {
	
	private MainPanel view;
	
	@Override
	public void actionPerformed(ActionEvent e) {
		Constituent constituent = new Constituent();
		constituent.setParent(null);
		constituent.setLabel("CL");
		
		view.setCurrentFile(null);
		view.setConstituent(constituent);
		view.clearPanels();
		view.loadSemantic(MainModuleController.setTextAreaSemantic(constituent, view));
	}
	
	public void setView(MainPanel view){
		this.view = view;
	}
}
